package com.woniuxy.common.mapper;

import com.woniuxy.common.entity.CenterLog;
import com.woniuxy.common.entity.CenterLogExample;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

public interface CenterLogMapper {
    long countByExample(CenterLogExample example);

    int deleteByExample(CenterLogExample example);

    int deleteByPrimaryKey(String centerLogid);

    int insert(CenterLog record);

    int insertSelective(CenterLog record);

    List<CenterLog> selectByExample(CenterLogExample example);

    CenterLog selectByPrimaryKey(String centerLogid);

    int updateByExampleSelective(@Param("record") CenterLog record, @Param("example") CenterLogExample example);

    int updateByExample(@Param("record") CenterLog record, @Param("example") CenterLogExample example);

    int updateByPrimaryKeySelective(CenterLog record);

    int updateByPrimaryKey(CenterLog record);

    /**
     * @return int
     * @Author ArmWatt
     * @Date 2020/4/29
     * @Param [centerCreatetime]
     * @Description 配合定时任务删除日志
     **/


    @Delete("delete from center_log where center_createtime <= #{centerCreatetime}")
    int deleteLogByDate(Date centerCreatetime);
}